<%@ page import="java.util.ArrayList" %>
<%@ page import="com.student.pojo.StuInfo" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<h1 id="title">学生信息</h1>
<%
    ArrayList stuInfoList=(ArrayList)request.getAttribute("stuInfoList");
%>

<form action="student.do" method="post" style="text-align: right;border: 0px solid rebeccapurple">
    <input type="hidden" name="opr" value="seeStudent"/>
    <input type="text" name="name" placeholder="请输入姓名" />
    <input type="submit" value="查询">
</form>

<table id="mytable" width="100%" border="1" cellpadding="0" cellspacing="0" style="text-align: center">
    <thead>
    <th>学生编号</th>
    <th>姓名</th>
    <th>密码</th>
    <th>性别</th>
    <th>年龄</th>
    <th>体重</th>
    <th>身高</th>
    <th>角色</th>
    <th>操作</th>
    </thead>

    <%
        for (int i = 0; i < stuInfoList.size(); i++) {
            StuInfo stuInfo = (StuInfo) stuInfoList.get(i);
    %>
    <tr>
        <td>
            <%=stuInfo.getId() %>
        </td>
        <td>
            <%=stuInfo.getName() %>
        </td>
        <td>
            <%=stuInfo.getPassword() %>
        </td>
        <td>
            <%=stuInfo.getSex() %>
        </td>
        <td>
            <%=stuInfo.getAge()%>
        </td>
        <td>
            <%=stuInfo.getWeight()%>
        </td>
        <td>
            <%=stuInfo.getHeight()%>
        </td>
        <td>
            <%=stuInfo.getRole()%>
        </td>
        <td>
            <a href="student.do?opr=delStudent&id=<%=stuInfo.getId() %>" >删除</a>
            <a href="student.do?opr=seeByIdStudent&id=<%=stuInfo.getId() %>" >修改</a>
        </td>
    </tr>
    <%
        }
    %>
</table>
